package com.zhuang.utils;

import com.zhuang.dto.QuestionDTO;
import com.zhuang.pojo.Question;
import org.springframework.beans.BeanUtils;

import java.util.List;

public class CommunityUtils {
    public static List<QuestionDTO> copyList(List<Question> list, List<QuestionDTO> list1){
        for (Question question:list) {
            QuestionDTO questionDTO = new QuestionDTO();
            BeanUtils.copyProperties(question, questionDTO);
            list1.add(questionDTO);
        }
        return list1;
    }
}
